<a href="#" onclick="Effect.toggle('toggle_appear', 'appear'); return false;">Search</a>
<div id="toggle_appear" style="display:none;background:#fff;">
  <div>
    <?php 
    echo $form->create("Role",array('action' => 'index'));
    //echo $form->input("q", array('label' => 'Search for'));
	echo "Name: ";
	echo $ajax->autoComplete('Role.name',array('label' => 'Search for'));
	echo $form->input('begincontain',array('type'=>'radio','legend' => false,'options' =>array('begin','contain'),'default' => 'begin'));
    echo $form->end('Search');
?> 
  </div>
</div>

<div class="roles">
<h2><?php __('Roles');?></h2>
<p>
<?php
echo $paginator->counter(array(
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
));
?></p>
<table cellpadding="0" cellspacing="0">
<tr>
	<th><?php echo $paginator->sort('id');?></th>
	<th><?php echo $paginator->sort('name');?></th>
	<th class="actions"><?php __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($roles as $role):
	$class = null;
	if ($i++ % 2 == 0) {
		$class = ' class="altrow"';
	}
?>
	<tr<?php echo $class;?> onMouseOver="javascript:trackTableHighlight(event, '#F5F6CE');" 
  onMouseOut="javascript:highlightTableRow(0);">
		<td>
			<?php echo $role['Role']['id'] ?>
		</td>
		<td>
			<?php echo $role['Role']['name'] ?>
		</td>
		<td class="actions">
			<?php echo $html->link(__('View', true), array('action'=>'view', $role['Role']['id'])); ?>
			<?php //echo $html->link(__('Edit', true), array('action'=>'edit', $role['Role']['id'])); ?>
			<?php
			echo $html->link('Edit',
			array('action' => 'edit', $role['Role']['id']),
			array(
				'title' => 'Edit Role'));
			?>
			<?php echo $html->link(__('Delete', true), array('action'=>'delete', $role['Role']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $role['Role']['id'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
</table>
</div>
<div class="paging">
	<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
 | 	<?php echo $paginator->numbers();?>
	<?php echo $paginator->next(__('next', true).' >>', array(), null, array('class'=>'disabled'));?>
</div>
<div class="actions">
	<ul>
		<li><?php echo $html->link(sprintf(__('New %s', true), __('Role', true)), array('action'=>'add')); ?></li>
		<li><?php echo $html->link(sprintf(__('List %s', true), __('Users', true)), array('controller'=> 'users', 'action'=>'index')); ?> </li>
		<li><?php echo $html->link(sprintf(__('New %s',  true), __('User', true)), array('controller'=> 'users', 'action'=>'add')); ?> </li>
	</ul>
</div>
